package com.ease.web.xwt.component;

/**
 * 
 * @author nathanleewei
 * 
 */
public class XInput extends XAbstractComponent {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8799194264169744092L;

	//
	public static final String TYPE_TEXT = "text";

	public static final String TYPE_PASSWORD = "password";

	public static final String TYPE_IMAGE = "image";

	public static final String TYPE_BUTTON = "button";

	public static final String TYPE_FILE = "file";

	public static final String TYPE_HIDDEN = "hidden";

	//
	public static final String TYPE_CHECKBOX = "checkbox";

	//
	private String type = TYPE_TEXT;

	private boolean readonly = false;

	private boolean disabled = false;

	private boolean numberOnly = false;

	protected String onClick;

	public XInput() {
		super();
	}

	protected String getTemplate() {
		return TEMPLATE_X_INPUT;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getOnClick() {
		return onClick;
	}

	public void setOnClick(String onClick) {
		this.onClick = onClick;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public boolean isReadonly() {
		return readonly;
	}

	public void setReadonly(boolean readonly) {
		this.readonly = readonly;
	}

	/**
	 * @param numberOnly
	 *            The numberOnly to set.
	 */
	public void setNumberOnly(boolean numberOnly) {
		this.numberOnly = numberOnly;
	}

	/**
	 * @return Returns the numberOnly.
	 */
	public boolean isNumberOnly() {
		return numberOnly;
	}

}